package com.siao.example.libaray.main.controller
{
	import com.siao.applications.ApplicationManager;
	import com.siao.example.libaray.Libaray;
	import com.siao.example.libaray.component.state.ComponentState;
	import com.siao.example.libaray.display.state.DisplayState;
	import com.siao.example.libaray.main.method.LibarayMethod;
	import com.siao.example.libaray.mvc.state.MVCState;
	import com.siao.mvc.Controller;
	import com.siao.mvc.notice.Notice;
	
	/**
	 * 示例状态切换控制器
	 * @author SiaoLeon
	 */
	public class LibarayStateSwitchController extends Controller
	{
		// -------------------------------------------------------------------------------------------------------- 静态常量
		
		// -------------------------------------------------------------------------------------------------------- 静态变量
		
		// -------------------------------------------------------------------------------------------------------- 静态方法
		
		// -------------------------------------------------------------------------------------------------------- 静态函数
		
		// -------------------------------------------------------------------------------------------------------- 属性
		
		// -------------------------------------------------------------------------------------------------------- 变量
		
		// -------------------------------------------------------------------------------------------------------- 构造
		
		/**
		 * 构造函数
		 */
		public function LibarayStateSwitchController()
		{
			super();
		}
		
		// -------------------------------------------------------------------------------------------------------- 方法
		
		override public function onAdd():void
		{
			this.register(LibarayMethod.ENTER_LIBARAY_MVC, ENTER_MVC_EXAMPLE);
			this.register(LibarayMethod.ENTER_LIBARAY_DISPLAY, ENTER_DISPLAY_EXAMPLE);
			this.register(LibarayMethod.ENTER_LIBARAY_COMPONENT, ENTER_COMPONENT_EXAMPLE);
		}
		
		// -------------------------------------------------------------------------------------------------------- 函数
		
		private function ENTER_MVC_EXAMPLE(notice:Notice):void
		{
			(ApplicationManager.instance.currentApplication as Libaray).main.switchState(MVCState);
		}
		
		private function ENTER_DISPLAY_EXAMPLE(notice:Notice):void
		{
			(ApplicationManager.instance.currentApplication as Libaray).main.switchState(DisplayState);
		}
		
		private function ENTER_COMPONENT_EXAMPLE(notice:Notice):void
		{
			(ApplicationManager.instance.currentApplication as Libaray).main.switchState(ComponentState);
		}
	
	}
}
